<?php
/**
 * Created by PhpStorm.
 * User: luanalex
 * Date: 2017/9/15
 * Time: 16:28
 */
?>

<?php
echo "今天是 " . date("Y/m/d") . "<br>";
echo "今天是 " . date("Y.m.d") . "<br>";
echo "今天是 " . date("Y-m-d") . "<br>";
echo "今天是 " . date("l"),"<br>";

?>
<!DOCTYPE html>
<html>
<body>

版权所有 2008-<?php echo date("Y")?>

h - 带有首位零的 12 小时小时格式<br>
i - 带有首位零的分钟<br>
s - 带有首位零的秒（00 -59）<br>
a - 小写的午前和午后（am 或 pm）<br>
<?php
echo "现在时间是 " . date("h:i:sa");
?>
<br>
<?php
date_default_timezone_set("Asia/Shanghai");
echo "当前时间是 " . date("h:i:sa");
?>
<br>
mktime(hour,minute,second,month,day,year)
<br>
<?php
$d=mktime(9, 12, 31, 6, 10, 2015);
echo "创建日期是 " . date("Y-m-d h:i:sa", $d);
?>
<br>
<?php
$d1=strtotime("December 31");
$d2=ceil(($d1-time())/60/60/24);
echo "距离十二月三十一日还有：" . $d2 ." 天。";
?>

</body>
</html>